import { Column, Entity, PrimaryGeneratedColumn, ManyToOne, JoinColumn } from 'typeorm';
import { BaseEntity } from 'src/common/entities/base';
import { NotifyInfoEntity } from './notify-info.entity';

@Entity('notify_info_files')
export class NotifyInfoFilesEntity extends BaseEntity {
  @PrimaryGeneratedColumn({ type: 'int', name: 'id', comment: '文件ID' })
  public id: number;

  @Column({ type: 'int', name: 'notify_id', comment: '通知ID' })
  public notifyId: number;

  @Column({ type: 'varchar', name: 'name', length: 255, comment: '文件名' })
  public name: string;

  @Column({ type: 'varchar', name: 'key', length: 255, comment: '阿里云key' })
  public key: string;

  @ManyToOne(() => NotifyInfoEntity, notify => notify.files)
  @JoinColumn({ name: 'notify_id' })
  notify: NotifyInfoEntity;
} 